/*
 * RibbonObject.h
 *
 *  Created on: 2009/02/17
 *      Author: Yongshik Cho
 */

#ifndef RIBBONOBJECT_H_
#define RIBBONOBJECT_H_

#include <list>
#include "core/Prerequisites.h"
#include "core/Vector3D.h"
#include "core/Color.h"
#include "RenderObject.h"


struct Ribbon
{
public:
	inline Vector3D& getPosition() { return mPosition; }
	inline void setPosition(const Vector3D& pos) { mPosition = pos; }
	inline Vector3D& getUp() { return mUp; }
	inline void setUp(const Vector3D& up) { mUp = up; }
	inline Vector3D& getBack() { return mBack; }
	inline void setBack(const Vector3D& back) { mBack = back; }
	inline float getLength() { return mLength; }
	inline void setLength(const float length) { mLength = length; }
	inline float getLength0() { return mLength0; }
	inline void setLength0(const float length) { mLength0 = length; }

private:
	Vector3D 	mPosition, mUp, mBack;
	float 		mLength, mLength0;
};

class RibbonObject : public RenderObject
{
public:
	RibbonObject();
	virtual ~RibbonObject();

public:
	void tick(const uint32 elapsed);

	inline const uint32 getRibbonCount() { return (uint32)mRibbons.size(); }
	void addRibbon(const Ribbon& ribbon);
	Ribbon* getRibbon(const uint32 index);
	inline list<Ribbon>& getRibbons() { return mRibbons; }

	inline Vector3D& getPosition() { return mPosition; }
	inline void setPosition(const Vector3D& pos) { mPosition = pos; }

	inline int32 getAnim() { return mAnim; }
	inline void setAnim(const int32 anim) { mAnim = anim; }

	inline int32 getTime() { return mTime; }
	inline void setTime(const int32 time) { mTime = time; }

	inline float getLength() { return mLength; }
	inline void setLength(const float length) { mLength = length; }
	inline float getSeglen() { return mSeglen; }
	inline void setSeglen(const float seglen) { mSeglen = seglen; }

	inline Vector3D& getTpos() { return mTpos; }
	inline void setTpos(const Vector3D& pos) { mTpos = pos; }
	inline Color& getTcolor() { return mTcolor; }
	inline void setTcolor(const Color& color) { mTcolor = color; }
	inline float getTabove() { return mTabove; }
	inline void setTabove(const float above) { mTabove = above; }
	inline float getTbelow() { return mTbelow; }
	inline void setTbelow(const float below) { mTbelow = below; }

	inline uint32 getTexture() { return mTexture; }

	inline const Color& getColor() const { return mColor; }
	inline void setColor(const Color& c) { mColor = c; }
	inline const uint16 getOpacity() const { return mOpacity; }
	inline void setOpacity(const uint16 opa) { mOpacity = opa; }
	inline const float getAbove() const { return mAbove; }
	inline void setAbove(const float a) { mAbove = a; }
	inline const float getBelow() const { return mBelow; }
	inline void setBelow(const float b) { mBelow = b; }
	inline const float getF1() const { return mF1; }
	inline void setF1(const float f) { mF1 = f; }
	inline const float getF2() const { return mF2; }
	inline void setF2(const float f) { mF2 = f; }

protected:
	Color 				mColor;
	uint16 				mOpacity;
	float 				mAbove, mBelow;
	float 				mF1, mF2;
	Vector3D 			mPosition;
	Vector3D 			mTpos;
	Color 				mTcolor;
	float 				mTabove, mTbelow;
	uint32 				mTexture;

	int32 				mAnim, mTime;
	float 				mLength, mSeglen;

	list<Ribbon>		mRibbons;
};

#endif /* RIBBONOBJECT_H_ */
